package com.ruoyi.ring.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ring.domain.RingGroupMember;
import com.ruoyi.ring.mapper.RingGroupMemberMapper;
import com.ruoyi.ring.service.IRingGroupMemberService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 群组成员Service业务层处理
 * 
 * @author liuwp
 * @date 2025-10-20
 */
@Service
public class RingGroupMemberServiceImpl implements IRingGroupMemberService 
{
    @Resource
    private RingGroupMemberMapper ringGroupMemberMapper;

    /**
     * 查询群组成员
     * 
     * @param id 群组成员主键
     * @return 群组成员
     */
    @Override
    public RingGroupMember selectRingGroupMemberById(Long id)
    {
        return ringGroupMemberMapper.selectRingGroupMemberById(id);
    }

    /**
     * 查询群组成员列表
     * 
     * @param ringGroupMember 群组成员
     * @return 群组成员
     */
    @Override
    public List<RingGroupMember> selectRingGroupMemberList(RingGroupMember ringGroupMember)
    {
        return ringGroupMemberMapper.selectRingGroupMemberList(ringGroupMember);
    }

    /**
     * 根据业务主键查询一条记录：群组成员
     *
     * @param ringGroupMember 群组成员
     * @return 群组成员
     */
    @Override
    public RingGroupMember selectOneRingGroupMember(RingGroupMember ringGroupMember)
    {
        return ringGroupMemberMapper.selectOneRingGroupMember(ringGroupMember);
    }

    /**
     * 新增群组成员
     * 
     * @param ringGroupMember 群组成员
     * @return 结果
     */
    @Override
    public int insertRingGroupMember(RingGroupMember ringGroupMember)
    {
        ringGroupMember.setCreateTime(DateUtils.getNowDate());
        return ringGroupMemberMapper.insertRingGroupMember(ringGroupMember);
    }

    /**
     * 修改群组成员
     * 
     * @param ringGroupMember 群组成员
     * @return 结果
     */
    @Override
    public int updateRingGroupMember(RingGroupMember ringGroupMember)
    {
        ringGroupMember.setUpdateTime(DateUtils.getNowDate());
        return ringGroupMemberMapper.updateRingGroupMember(ringGroupMember);
    }

    @Override
    public int updateRingGroupMemberCondition(RingGroupMember ringGroupMember, RingGroupMember ringGroupMemberCondition)
    {
                ringGroupMember.setUpdateTime(DateUtils.getNowDate());
        return ringGroupMemberMapper.updateRingGroupMemberCondition(ringGroupMember, ringGroupMemberCondition);
    }

    /**
     * 批量删除群组成员
     * 
     * @param ids 需要删除的群组成员主键
     * @return 结果
     */
    @Override
    public int deleteRingGroupMemberByIds(Long[] ids)
    {
        return ringGroupMemberMapper.deleteRingGroupMemberByIds(ids);
    }

    /**
     * 删除群组成员信息
     * 
     * @param id 群组成员主键
     * @return 结果
     */
    @Override
    public int deleteRingGroupMemberById(Long id)
    {
        return ringGroupMemberMapper.deleteRingGroupMemberById(id);
    }

    /**
     * 条件删除群组成员
     *
     * @param ringGroupMember 群组成员
     * @return 结果
     */
    @Override
    public int deleteRingGroupMemberByCondition(RingGroupMember ringGroupMember)
    {
        return ringGroupMemberMapper.deleteRingGroupMemberByCondition(ringGroupMember);
    }

}
